import { createRouter, createWebHistory } from 'vue-router'



const routes = [
  {
    path: '/',
    name: 'host',
    redirect: '/home'
  },
  {
    path: "/home",
    name: 'home',
    component: () => import('@/views/Home.vue'),
    redirect: "/goods",
    children: [
   
      {
          path: '/goods',
          name: 'goods',
          component: () => import(/* webpackChunkName: "new" */ '@/views/Goods.vue')
      },
      {
        path: '/order',
        name: 'order',
        component: () => import(/* webpackChunkName: "new" */ '@/views/Order.vue')
      },
      {
        path: '/goodsSaveOrUpdate',
        component: () => import(/* webpackChunkName: "new" */ '@/views/GoodsSaveOrUpdate.vue')
      },
      {
        path: '/user',
        component: () => import(/* webpackChunkName: "new" */ '@/views/User.vue')
      },
      {
        path: '/role',
        component: () => import(/* webpackChunkName: "new" */ '@/views/Role.vue')
      },
      {
        path: '/permission',
        component: () => import(/* webpackChunkName: "new" */ '@/views/permission.vue')
      },
      {
        path: '/permissionSaveOrUpdate',
        component: () => import(/* webpackChunkName: "new" */ '@/views/permissionSaveOrUpdate.vue')
      },
      {
        path: '/roleSaveOrUpdate',
        component: () => import(/* webpackChunkName: "new" */ '@/views/RoleSaveOrUpdate.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "new" */ '@/views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import(/* webpackChunkName: "new" */ '@/views/Register.vue')
  },

]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
